package com.lzy.cloud.order.remote;

import com.lzy.cloud.order.remote.dtos.CarCalendarDto;
import com.lzy.cloud.order.request.CarCalendarRequest;
import com.lzy.cloud.order.request.TimeAndOvertimeBillingRequest;
import com.lzy.framework.core.output.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Description: 档期接口
 * @Author:   gyl
 * @Date:     2018/7/9 17:31
 */
@FeignClient(name = "lzy-cloud-goods")
public interface CarCalendarApi {
    /**
     * 获取单个房车的单个档期(一个日期)详情
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/car/calendar/detail",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    Result detail(@RequestBody CarCalendarRequest request);

    /**
     * 查询有没有空档期，有就占用
     * @param carCalendarDto
     * @return
     */
    @RequestMapping(value = "/car/calendar/find/occupy",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    Result findEmptyCalendarAndOccupy(@RequestBody CarCalendarDto carCalendarDto);

    /**
     * 房车租赁下订单 查询超时计费价格
     * @param request
     * @return
     */
    @RequestMapping(value = "/car/calendar/time/find/price",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    Result findOverTimePrice(@RequestBody TimeAndOvertimeBillingRequest request);

    /**
     * 释放档期
     * @param carCalendarDto
     * @return
     */
    @RequestMapping(value = "/car/calendar/release",method = RequestMethod.GET, consumes = MediaType.APPLICATION_JSON_VALUE)
    Result releaseCalendar( CarCalendarDto carCalendarDto);
}
